import {
  CoursewareStep1,
  CoursewareStep2
} from '@/layout/components'
export default {
  components: {
    CoursewareStep1,
    CoursewareStep2
  },
  data() {
    return {
      formData: {
        courseId: null, // 课程ID，新增不要，编辑必须
        courseName: '', // 课程名称
        courseCoverPath: '', // 课程封面
        learningPhaseId: '', // 学段ID
        courseGradeId: '', // 年级ID
        courseSubjectId: '', // 学科ID
        courseVersionId: '', // 课程版本ID
        courseVolumeId: '', // 册别ID
        coursePower: 1, // 权限：1本校；2公开；
        coursePrice: 1.00 // 课程价格
      },
      stepActive: 0,
      stepDatas: [
        {
          id: 1,
          title: '基本信息',
          description: ''
        },
        {
          id: 2,
          title: '课节编辑',
          description: ''
        }
      ]
    }
  },
  created() {
    if (this.$route.query.stepActive) {
      this.stepActive = Number(this.$route.query.stepActive)
    } else {
      this.stepActive = 0
    }
  },
  watch: {
    $route: {
      handler() {
        this.stepActive = Number(this.$route.query.stepActive)
      },
      deep: true // 深度监听，同时也可监听到param参数变化
    }
  },
  methods: {
    backCoursewareStep1(data) {
      this.formData = data
    }
  }
}
